#include "img_struct.h"

statistics_config_t ov9718_tile_config = {
	1,
	1,

	24,
	16,
	128,
	48,
	160,
	250,
	160,
	250,
	0,
	14745,

	12,
	8,
	0,
	8,
	340,
	512,

	8,
	5,
	256,
	10,
	448,
	816,
	448,
	816,

	0,
	16383,
};

 line_t ov9718_50hz_lines[] = {
		{
		{{SHUTTER_1BY8000, ISO_100, 0}}, {{SHUTTER_1BY100, ISO_100,0}}
		},

		{
		{{SHUTTER_1BY100, ISO_100, 0}}, {{SHUTTER_1BY100, ISO_300, 0}}
		},

		{
		{{SHUTTER_1BY50, ISO_100, 0}}, {{SHUTTER_1BY50, ISO_800,0}}
		},

		{
		{{SHUTTER_1BY30, ISO_100, 0}}, {{SHUTTER_1BY30, ISO_1600,0}}
		}
};


 line_t ov9718_60hz_lines[] = {
		{
		{{SHUTTER_1BY8000, ISO_100, 0}}, {{SHUTTER_1BY120, ISO_100,0}}
		},

		{
		{{SHUTTER_1BY120, ISO_100, 0}}, {{SHUTTER_1BY120, ISO_300, 0}}
		},

		{
		{{SHUTTER_1BY60, ISO_100, 0}}, {{SHUTTER_1BY60, ISO_800,0}}
		},

		{
		{{SHUTTER_1BY30, ISO_100, 0}}, {{SHUTTER_1BY30, ISO_1600,0}}
		}
};

img_awb_param_t ov9718_awb_param = {
	{
		{1781, 1024, 1513},	//AUTOMATIC
		{900, 1024, 1450},	//INCANDESCENT
		{1150, 1024, 1950},	//D4000
		{1250, 1024, 1550},	//D5000
		{1450, 1024, 1480},	//SUNNY
		{1580, 1024, 1380},	//CLOUDY
		{1750, 1024, 1400},	//FLASH
		{1250, 1024, 1825},	//FLUORESCENT
		{1750, 1024, 1400},	//FLUORESCENT_H
		{1024, 1024, 1024},	//UNDER WATER
		{1775, 1024, 1200},	//CUSTOM
		{1781, 1024, 1513},	//AUTOMATIC OUTDOOR
	},
	{
		12,
		{{ 820, 1500, 1750, 3000, -1250, 3100, -1150, 4250, 1000, 1050, 1000,  2050, 1 }, // 0	INCANDESCENT
		 {  950, 1830, 1650, 2550, -1250, 3100, -1200, 4300, 1000,   550, 1000,  1200, 2 }, // 1	D4000
		 {1150, 2150, 1200, 2270, -1270, 3100, -1000, 3950, 1000, -200, 1000,    600, 4 }, // 2	D5000
		 {1500, 2300, 1000, 1930,  -900, 2600,  -1000, 3950,  650,    100,  650,     650, 8 }, // 3	SUNNY
		 {1650, 2350, 1100, 1800,  -650, 2200,  -1000, 3950,  550,  -100,  550,     750, 4 }, // 4	CLOUDY
		 {2350, 2800, 1600, 2050, -1000, 3950, -1000, 4700, 550,     150,  550,     720, 0 },	// 5	PROJECTOR
		 {   0,    0,    0,    0,     0,    0,     0,    0,    0,     0,    0,     0, 0 },	// 6	D10000
		 {   0,    0,    0,    0,     0,    0,     0,    0,    0,     0,    0,     0, 0 },	// 7    FLASH
		 {   0,    0,    0,    0,     0,    0,     0,    0,    0,     0,    0,     0, 0 }, // 8    FLUORESCENT
		 {   0,    0,    0,    0,     0,    0,     0,    0,    0,     0,    0,     0, 0 }, // 9    FLUORESCENT_2
		 {   0,    0,    0,    0,     0,    0,     0,    0,    0,     0,    0,     0, 0 },	// 10  FLUORESCENT_3
		 {   0,    0,    0,    0,     0,    0,     0,    0,    0,     0,    0,     0, 0 }}, //11 CUSTOM
	},
	{	{ 0 ,6},	//LUT num. AUTOMATIC  INDOOR
		{ 0, 1},	//LUT num. INCANDESCENT
		{ 1, 1},	//LUT num. D4000
		{ 2, 1},	//LUT num. D5000
		{ 2, 5},	//LUT num. SUNNY
		{ 4, 3},	//LUT num. CLOUDY
		{ 7, 1},	//LUT num. FLASH
		{ 8, 1},	//LUT num. FLUORESCENT
		{ 9, 1},	//LUT num. FLUORESCENT_H
		{11, 1},	//LUT num. UNDER WATER
		{11, 1},	//LUT num. CUSTOM
		{ 0, 7},	//LUT num. AUTOMATIC  OUTDOOR
	 }
};
u32 ov9718_ae_agc_dgain[769]={
		961,
		901,906,912,917,922,926,931,936,874,879,883,888,893,897,903,907,
		870,875,880,884,889,894,898,904,853,857,862,866,872,875,881,885,
		857,862,867,872,877,881,885,890,850,854,859,863,868,873,877,883,
		846,849,854,859,863,868,873,878,851,856,861,865,870,875,880,884,
		848,852,857,861,865,871,875,880,848,852,857,861,866,871,876,881,
		850,855,859,864,869,874,878,883,863,868,872,876,880,886,891,895,
		864,869,874,878,883,888,892,897,870,874,878,882,887,892,897,902,
		880,885,889,894,899,904,909,914,968,973,978,983,988,994,999,1005,
		953,958,963,969,975,980,985,991,924,929,934,939,945,950,955,960,
		921,927,931,936,941,947,951,956,905,910,914,919,924,930,934,939,
		902,907,911,917,922,926,932,937,897,902,907,912,917,921,926,932,
		893,898,902,907,913,918,923,928,899,904,908,913,918,923,929,934,
		906,911,916,920,926,931,936,941,903,908,912,916,922,927,933,937,
		905,909,914,919,925,930,935,940,910,916,921,926,930,935,941,946,
		919,924,930,935,940,945,950,955,927,932,937,941,947,951,957,961,
		939,945,950,955,961,967,971,977,954,959,965,969,975,980,986,990,
		936,941,946,951,957,962,967,972,910,914,919,924,929,934,939,944,
		904,909,914,918,923,929,934,938,891,896,901,905,911,916,921,914,
		885,890,895,900,905,909,915,919,879,884,889,893,898,903,908,914,
		882,887,892,897,902,906,911,916,891,895,900,905,909,914,920,925,
		889,894,899,903,908,913,918,923,884,889,893,898,903,908,913,917,
		891,897,902,907,912,916,922,926,896,900,905,911,916,920,925,931,
		904,909,913,918,923,928,934,939,911,917,921,927,932,937,941,947,
		924,930,934,939,945,949,955,960,977,982,988,994,999,1005,1010,1016,
		957,963,968,973,978,984,989,994,933,939,944,948,954,959,965,970,
		925,929,935,940,945,950,956,960,912,917,922,927,932,937,942,947,
		905,910,915,920,925,930,935,940,899,903,908,913,918,923,928,934,
		901,905,910,915,920,925,930,935,906,912,917,921,926,932,937,942,
		908,913,918,922,928,933,938,943,901,906,911,916,921,926,930,932,
		912,917,921,926,931,936,941,947,919,925,929,935,941,946,950,956,
		927,931,936,942,947,952,957,963,933,938,943,948,953,958,963,969,
		944,948,954,959,964,969,974,980,975,980,985,991,997,1002,1007,1013,
		955,960,965,971,976,981,986,991,929,934,940,945,950,954,960,965,
		919,924,929,935,940,945,950,955,911,917,921,926,931,936,942,947,
		905,910,916,921,926,930,934,940,899,904,909,914,919,924,929,933,
		900,905,910,915,920,924,929,935,904,909,914,919,924,929,934,939,
		907,912,917,922,927,932,938,942,901,905,910,915,920,925,931,936,
		911,916,921,926,931,936,941,946,916,922,927,931,937,941,947,952,
		923,928,932,937,942,948,952,958,933,937,942,947,952,958,963,968,
		945,949,955,959,965,970,975,980,986,991,996,1002,1007,1012,1018,1024,
		1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
		1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
		1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
		1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
		1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
		1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
		1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
		1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,

	};
u32 ov9718_ae_sht_dgain[1036] ={
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,
	1024,1057,1052,1046,1040,1036,1029,1024,1060,1055,1049,1044,1039,1034,1029,1024,
	1062,1056,1050,1046,1040,1034,1029,1024,1063,1057,1051,1047,1041,1035,1030,1024,
	1065,1060,1055,1050,1045,1039,1035,1029,1024,1068,1062,1056,1051,1045,1040,1035,
	1029,1024,1070,1064,1060,1054,1048,1044,1039,1034,1029,1024,1072,1067,1061,1056,
	1050,1044,1040,1033,1028,1024,1075,1069,1064,1058,1053,1049,1043,1039,1033,1028,
	1024,1078,1072,1068,1063,1058,1053,1048,1043,1039,1033,1028,1024,1081,1077,1071,
	1065,1061,1055,1050,1045,1040,1034,1029,1024,1087,1081,1076,1071,1066,1060,1055,
	1050,1044,1039,1034,1028,1024,1090,1085,1080,1075,1070,1065,1059,1055,1049,1044,
	1039,1033,1028,1024,1096,1091,1087,1081,1078,1073,1067,1063,1057,1052,1048,1043,
	1038,1034,1028,1024,1103,1097,1093,1088,1083,1079,1073,1067,1064,1058,1053,1049,
	1043,1038,1033,1028,1024,1110,1104,1100,1095,1089,1085,1079,1073,1069,1064,1059,
	1054,1049,1044,1039,1033,1029,1024,1119,1115,1110,1105,1101,1095,1091,1086,1081,
	1077,1071,1066,1062,1057,1052,1048,1043,1038,1034,1028,1024,1130,1125,1121,1115,
	1110,1106,1101,1095,1091,1086,1081,1076,1072,1068,1063,1057,1053,1048,1042,1038,
	1033,1027,1024,1155,1150,1145,1139,1133,1129,1123,1118,1113,1107,1102,1098,1092,
	1086,1082,1076,1070,1066,1060,1055,1050,1044,1039,1034,1029,1024,1177,1171,1167,
	1162,1156,1152,1147,1141,1136,1131,1125,1121,1116,1110,1106,1100,1095,1090,1085,
	1079,1075,1070,1064,1060,1054,1049,1044,1039,1033,1029,1024,1205,1201,1195,1190,
	1186,1180,1175,1171,1165,1159,1155,1150,1144,1140,1134,1129,1125,1119,1113,1110,
	1104,1099,1095,1089,1083,1080,1074,1068,1065,1059,1054,1050,1044,1038,1035,1029,
	1024,1247,1242,1236,1232,1227,1221,1217,1212,1207,1202,1197,1192,1188,1182,1178,
	1173,1167,1162,1158,1152,1148,1143,1138,1133,1128,1122,1118,1113,1107,1104,1098,
	1093,1089,1083,1078,1074,1069,1063,1059,1053,1048,1044,1039,1034,1029,1024,1311,
	1306,1301,1297,1292,1287,1283,1278,1273,1269,1264,1259,1255,1250,1245,1242,1236,
	1231,1227,1222,1217,1213,1208,1204,1199,
	};
u8 ov9718_dlight[2] = {128,4};
